1use crate::co;
2use crate::decl::*;
3use crate::kernel::privs::*;
4use crate::msg::*;
5use crate::ole::privs::*;
6use crate::prelude::*;
7use crate::user::privs::*;
8
9pub struct ApproximateViewRect {
14 pub num_items: Option<u32>,
15 pub proposed_x: Option<u16>,
16 pub proposed_y: Option<u16>,
17}
18
19impl MsgSend for ApproximateViewRect {
20 type RetType = SIZE;
21
22 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
23 SIZE::from(v as u32)
24 }
25
26 fn as_generic_wm(&mut self) -> WndMsg {
27 WndMsg {
28 msg_id: co::LVM::APPROXIMATEVIEWRECT.into(),
29 wparam: self.num_items.map_or(-1, |n| n as i32) as _,
30 lparam: MAKEDWORD(
31 self.proposed_x.map_or(-1, |x| x as i32) as _,
32 self.proposed_y.map_or(-1, |y| y as i32) as _,
33 ) as _,
34 }
35 }
36}
37
38pub struct Arrange {
43 pub arrangement: co::LVA,
44}
45
46impl MsgSend for Arrange {
47 type RetType = SysResult<()>;
48
49 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
50 zero_as_badargs(v).map(|_| ())
51 }
52
53 fn as_generic_wm(&mut self) -> WndMsg {
54 WndMsg {
55 msg_id: co::LVM::ARRANGE.into(),
56 wparam: self.arrangement.raw() as _,
57 lparam: 0,
58 }
59 }
60}
61
62pub_struct_msg_empty! { CancelEditLabel: co::LVM::CANCELEDITLABEL.into();
63 }
65
66pub struct CreateDragImage<'a> {
71 pub index: u32,
72 pub img_location: &'a mut RECT,
73}
74
75impl<'a> MsgSend for CreateDragImage<'a> {
76 type RetType = SysResult<HIMAGELIST>;
77
78 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
79 zero_as_badargs(v).map(|p| HIMAGELIST::from_ptr(p as _))
80 }
81
82 fn as_generic_wm(&mut self) -> WndMsg {
83 WndMsg {
84 msg_id: co::LVM::CREATEDRAGIMAGE.into(),
85 wparam: self.index as _,
86 lparam: self.img_location as *mut _ as _,
87 }
88 }
89}
90
91pub struct DeleteAllItems {}
96
97impl MsgSend for DeleteAllItems {
98 type RetType = SysResult<()>;
99
100 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
101 zero_as_badargs(v).map(|_| ())
102 }
103
104 fn as_generic_wm(&mut self) -> WndMsg {
105 WndMsg {
106 msg_id: co::LVM::DELETEALLITEMS.into(),
107 wparam: 0,
108 lparam: 0,
109 }
110 }
111}
112
113pub struct DeleteColumn {
118 pub index: u32,
119}
120
121impl MsgSend for DeleteColumn {
122 type RetType = SysResult<()>;
123
124 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
125 zero_as_badargs(v).map(|_| ())
126 }
127
128 fn as_generic_wm(&mut self) -> WndMsg {
129 WndMsg {
130 msg_id: co::LVM::DELETECOLUMN.into(),
131 wparam: self.index as _,
132 lparam: 0,
133 }
134 }
135}
136
137pub struct DeleteItem {
142 pub index: u32,
143}
144
145impl MsgSend for DeleteItem {
146 type RetType = SysResult<()>;
147
148 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
149 zero_as_badargs(v).map(|_| ())
150 }
151
152 fn as_generic_wm(&mut self) -> WndMsg {
153 WndMsg {
154 msg_id: co::LVM::DELETEITEM.into(),
155 wparam: self.index as _,
156 lparam: 0,
157 }
158 }
159}
160
161pub struct EditLabel {
166 pub index: Option<u32>,
167}
168
169impl MsgSend for EditLabel {
170 type RetType = SysResult<HWND>;
171
172 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
173 zero_as_badargs(v).map(|p| HWND::from_ptr(p as _))
174 }
175
176 fn as_generic_wm(&mut self) -> WndMsg {
177 WndMsg {
178 msg_id: co::LVM::EDITLABEL.into(),
179 wparam: self.index.map_or(-1, |i| i as i32) as _,
180 lparam: 0,
181 }
182 }
183}
184
185pub struct EnableGroupView {
190 pub enable: bool,
191}
192
193impl MsgSend for EnableGroupView {
194 type RetType = SysResult<bool>;
195
196 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
197 minus1_as_badargs(v).map(|v| v != 0)
198 }
199
200 fn as_generic_wm(&mut self) -> WndMsg {
201 WndMsg {
202 msg_id: co::LVM::ENABLEGROUPVIEW.into(),
203 wparam: self.enable as _,
204 lparam: 0,
205 }
206 }
207}
208
209pub struct EnsureVisible {
214 pub index: u32,
215 pub entirely_visible: bool,
216}
217
218impl MsgSend for EnsureVisible {
219 type RetType = SysResult<()>;
220
221 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
222 zero_as_badargs(v).map(|_| ())
223 }
224
225 fn as_generic_wm(&mut self) -> WndMsg {
226 WndMsg {
227 msg_id: co::LVM::ENSUREVISIBLE.into(),
228 wparam: self.index as _,
229 lparam: !self.entirely_visible as _,
230 }
231 }
232}
233
234pub struct FindItem<'a, 'b> {
239 pub start_index: Option<u32>,
240 pub lvfindinfo: &'b LVFINDINFO<'a>,
241}
242
243impl<'a, 'b> MsgSend for FindItem<'a, 'b> {
244 type RetType = Option<u32>;
245
246 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
247 minus1_as_none(v).map(|v| v as _)
248 }
249
250 fn as_generic_wm(&mut self) -> WndMsg {
251 WndMsg {
252 msg_id: co::LVM::FINDITEM.into(),
253 wparam: self.start_index.map_or(-1, |idx| idx as i32) as _,
254 lparam: self.lvfindinfo as *const _ as _,
255 }
256 }
257}
258
259pub struct GetBkColor {}
264
265impl MsgSend for GetBkColor {
266 type RetType = COLORREF;
267
268 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
269 COLORREF::from_raw(v as _)
270 }
271
272 fn as_generic_wm(&mut self) -> WndMsg {
273 WndMsg {
274 msg_id: co::LVM::GETBKCOLOR.into(),
275 wparam: 0,
276 lparam: 0,
277 }
278 }
279}
280
281pub struct GetBkImage<'a, 'b> {
286 pub lvbkimage: &'b mut LVBKIMAGE<'a>,
287}
288
289impl<'a, 'b> MsgSend for GetBkImage<'a, 'b> {
290 type RetType = SysResult<()>;
291
292 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
293 zero_as_badargs(v).map(|_| ())
294 }
295
296 fn as_generic_wm(&mut self) -> WndMsg {
297 WndMsg {
298 msg_id: co::LVM::GETBKIMAGE.into(),
299 wparam: 0,
300 lparam: self.lvbkimage as *mut _ as _,
301 }
302 }
303}
304
305pub struct GetCallbackMask {}
310
311impl MsgSend for GetCallbackMask {
312 type RetType = co::LVIS;
313
314 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
315 co::LVIS::from_raw(v as _)
316 }
317
318 fn as_generic_wm(&mut self) -> WndMsg {
319 WndMsg {
320 msg_id: co::LVM::GETCALLBACKMASK.into(),
321 wparam: 0,
322 lparam: 0,
323 }
324 }
325}
326
327pub struct GetColumn<'a, 'b> {
332 pub index: u32,
333 pub lvcolumn: &'b mut LVCOLUMN<'a>,
334}
335
336impl<'a, 'b> MsgSend for GetColumn<'a, 'b> {
337 type RetType = SysResult<()>;
338
339 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
340 zero_as_badargs(v).map(|_| ())
341 }
342
343 fn as_generic_wm(&mut self) -> WndMsg {
344 WndMsg {
345 msg_id: co::LVM::GETCOLUMN.into(),
346 wparam: self.index as _,
347 lparam: self.lvcolumn as *mut _ as _,
348 }
349 }
350}
351
352pub struct GetColumnOrderArray<'a> {
357 pub indexes: &'a mut Vec<u32>,
358}
359
360impl<'a> MsgSend for GetColumnOrderArray<'a> {
361 type RetType = SysResult<()>;
362
363 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
364 zero_as_badargs(v).map(|_| ())
365 }
366
367 fn as_generic_wm(&mut self) -> WndMsg {
368 WndMsg {
369 msg_id: co::LVM::GETCOLUMNORDERARRAY.into(),
370 wparam: self.indexes.len() as _,
371 lparam: self.indexes.as_mut_ptr() as _,
372 }
373 }
374}
375
376pub struct GetColumnWidth {
381 pub index: u32,
382}
383
384impl MsgSend for GetColumnWidth {
385 type RetType = SysResult<u32>;
386
387 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
388 minus1_as_badargs(v).map(|v| v as _)
389 }
390
391 fn as_generic_wm(&mut self) -> WndMsg {
392 WndMsg {
393 msg_id: co::LVM::GETCOLUMNWIDTH.into(),
394 wparam: self.index as _,
395 lparam: 0,
396 }
397 }
398}
399
400pub struct GetCountPerPage {}
405
406impl MsgSend for GetCountPerPage {
407 type RetType = u32;
408
409 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
410 v as _
411 }
412
413 fn as_generic_wm(&mut self) -> WndMsg {
414 WndMsg {
415 msg_id: co::LVM::GETCOUNTPERPAGE.into(),
416 wparam: 0,
417 lparam: 0,
418 }
419 }
420}
421
422pub struct GetEditControl {}
427
428impl MsgSend for GetEditControl {
429 type RetType = Option<HWND>;
430
431 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
432 zero_as_none(v).map(|p| HWND::from_ptr(p as _))
433 }
434
435 fn as_generic_wm(&mut self) -> WndMsg {
436 WndMsg {
437 msg_id: co::LVM::GETEDITCONTROL.into(),
438 wparam: 0,
439 lparam: 0,
440 }
441 }
442}
443
444pub struct GetEmptyText<'a> {
449 pub text: &'a mut WString,
450}
451
452impl<'a> MsgSend for GetEmptyText<'a> {
453 type RetType = SysResult<()>;
454
455 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
456 zero_as_badargs(v).map(|_| ())
457 }
458
459 fn as_generic_wm(&mut self) -> WndMsg {
460 WndMsg {
461 msg_id: co::LVM::GETEMPTYTEXT.into(),
462 wparam: self.text.buf_len(),
463 lparam: unsafe { self.text.as_mut_ptr() } as _,
464 }
465 }
466}
467
468pub struct GetExtendedListViewStyle {}
473
474impl MsgSend for GetExtendedListViewStyle {
475 type RetType = co::LVS_EX;
476
477 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
478 co::LVS_EX::from_raw(v as _)
479 }
480
481 fn as_generic_wm(&mut self) -> WndMsg {
482 WndMsg {
483 msg_id: co::LVM::GETEXTENDEDLISTVIEWSTYLE.into(),
484 wparam: 0,
485 lparam: 0,
486 }
487 }
488}
489
490pub struct GetFocusedGroup {}
495
496impl MsgSend for GetFocusedGroup {
497 type RetType = Option<u32>;
498
499 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
500 minus1_as_none(v).map(|v| v as _)
501 }
502
503 fn as_generic_wm(&mut self) -> WndMsg {
504 WndMsg {
505 msg_id: co::LVM::GETFOCUSEDGROUP.into(),
506 wparam: 0,
507 lparam: 0,
508 }
509 }
510}
511
512pub struct GetFooterInfo<'a, 'b> {
517 pub info: &'b mut LVFOOTERINFO<'a>,
518}
519
520impl<'a, 'b> MsgSend for GetFooterInfo<'a, 'b> {
521 type RetType = ();
522
523 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
524 ()
525 }
526
527 fn as_generic_wm(&mut self) -> WndMsg {
528 WndMsg {
529 msg_id: co::LVM::GETFOOTERINFO.into(),
530 wparam: 0,
531 lparam: self.info as *mut _ as _,
532 }
533 }
534}
535
536pub struct GetFooterItem<'a, 'b> {
541 pub index: u32,
542 pub info: &'b mut LVFOOTERITEM<'a>,
543}
544
545impl<'a, 'b> MsgSend for GetFooterItem<'a, 'b> {
546 type RetType = SysResult<()>;
547
548 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
549 zero_as_badargs(v).map(|_| ())
550 }
551
552 fn as_generic_wm(&mut self) -> WndMsg {
553 WndMsg {
554 msg_id: co::LVM::GETFOOTERITEM.into(),
555 wparam: self.index as _,
556 lparam: self.info as *mut _ as _,
557 }
558 }
559}
560
561pub struct GetFooterItemRect<'a> {
566 pub index: u32,
567 pub rect: &'a mut RECT,
568}
569
570impl<'a> MsgSend for GetFooterItemRect<'a> {
571 type RetType = SysResult<()>;
572
573 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
574 zero_as_badargs(v).map(|_| ())
575 }
576
577 fn as_generic_wm(&mut self) -> WndMsg {
578 WndMsg {
579 msg_id: co::LVM::GETFOOTERITEMRECT.into(),
580 wparam: self.index as _,
581 lparam: self.rect as *mut _ as _,
582 }
583 }
584}
585
586pub struct GetFooterRect<'a> {
591 pub rect: &'a mut RECT,
592}
593
594impl<'a> MsgSend for GetFooterRect<'a> {
595 type RetType = SysResult<()>;
596
597 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
598 zero_as_badargs(v).map(|_| ())
599 }
600
601 fn as_generic_wm(&mut self) -> WndMsg {
602 WndMsg {
603 msg_id: co::LVM::GETFOOTERRECT.into(),
604 wparam: 0,
605 lparam: self.rect as *mut _ as _,
606 }
607 }
608}
609
610pub struct GetGroupCount {}
615
616impl MsgSend for GetGroupCount {
617 type RetType = u32;
618
619 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
620 v as _
621 }
622
623 fn as_generic_wm(&mut self) -> WndMsg {
624 WndMsg {
625 msg_id: co::LVM::GETGROUPCOUNT.into(),
626 wparam: 0,
627 lparam: 0,
628 }
629 }
630}
631
632pub struct GetGroupInfo<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
637 pub id: u32,
638 pub info: &'h mut LVGROUP<'a, 'b, 'c, 'd, 'e, 'f, 'g>,
639}
640
641impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> MsgSend for GetGroupInfo<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
642 type RetType = SysResult<u32>;
643
644 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
645 minus1_as_badargs(v).map(|v| v as _)
646 }
647
648 fn as_generic_wm(&mut self) -> WndMsg {
649 WndMsg {
650 msg_id: co::LVM::GETGROUPINFO.into(),
651 wparam: self.id as _,
652 lparam: self.info as *mut _ as _,
653 }
654 }
655}
656
657pub struct GetGroupInfoByIndex<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
662 pub index: u32,
663 pub info: &'h mut LVGROUP<'a, 'b, 'c, 'd, 'e, 'f, 'g>,
664}
665
666impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> MsgSend
667 for GetGroupInfoByIndex<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>
668{
669 type RetType = SysResult<()>;
670
671 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
672 zero_as_badargs(v).map(|_| ())
673 }
674
675 fn as_generic_wm(&mut self) -> WndMsg {
676 WndMsg {
677 msg_id: co::LVM::GETGROUPINFOBYINDEX.into(),
678 wparam: self.index as _,
679 lparam: self.info as *mut _ as _,
680 }
681 }
682}
683
684pub struct GetGroupMetrics<'a> {
689 pub info: &'a mut LVGROUPMETRICS,
690}
691
692impl<'a> MsgSend for GetGroupMetrics<'a> {
693 type RetType = ();
694
695 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
696 ()
697 }
698
699 fn as_generic_wm(&mut self) -> WndMsg {
700 WndMsg {
701 msg_id: co::LVM::GETGROUPMETRICS.into(),
702 wparam: 0,
703 lparam: self.info as *mut _ as _,
704 }
705 }
706}
707
708pub struct GetGroupRect<'a> {
713 pub id: u32,
714 pub flags: co::LVGGR,
715 pub rect: &'a mut RECT,
716}
717
718impl<'a> MsgSend for GetGroupRect<'a> {
719 type RetType = SysResult<()>;
720
721 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
722 zero_as_badargs(v).map(|_| ())
723 }
724
725 fn as_generic_wm(&mut self) -> WndMsg {
726 self.rect.top = self.flags.raw();
727
728 WndMsg {
729 msg_id: co::LVM::GETGROUPRECT.into(),
730 wparam: self.id as _,
731 lparam: self.rect as *mut _ as _,
732 }
733 }
734}
735
736pub struct GetGroupState {
741 pub id: u32,
742 pub mask: co::LVGS,
743}
744
745impl MsgSend for GetGroupState {
746 type RetType = co::LVGS;
747
748 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
749 co::LVGS::from_raw(v as _)
750 }
751
752 fn as_generic_wm(&mut self) -> WndMsg {
753 WndMsg {
754 msg_id: co::LVM::GETGROUPSTATE.into(),
755 wparam: self.id as _,
756 lparam: self.mask.raw() as _,
757 }
758 }
759}
760
761pub struct GetHeader {}
766
767impl MsgSend for GetHeader {
768 type RetType = SysResult<HWND>;
769
770 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
771 zero_as_badargs(v).map(|p| HWND::from_ptr(p as _))
772 }
773
774 fn as_generic_wm(&mut self) -> WndMsg {
775 WndMsg {
776 msg_id: co::LVM::GETHEADER.into(),
777 wparam: 0,
778 lparam: 0,
779 }
780 }
781}
782
783pub struct GetHotCursor {}
788
789impl MsgSend for GetHotCursor {
790 type RetType = SysResult<HCURSOR>;
791
792 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
793 zero_as_badargs(v).map(|p| HCURSOR::from_ptr(p as _))
794 }
795
796 fn as_generic_wm(&mut self) -> WndMsg {
797 WndMsg {
798 msg_id: co::LVM::GETHOTCURSOR.into(),
799 wparam: 0,
800 lparam: 0,
801 }
802 }
803}
804
805pub struct GetHotItem {}
810
811impl MsgSend for GetHotItem {
812 type RetType = Option<u32>;
813
814 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
815 zero_as_none(v).map(|idx| idx as _)
816 }
817
818 fn as_generic_wm(&mut self) -> WndMsg {
819 WndMsg {
820 msg_id: co::LVM::GETHOTITEM.into(),
821 wparam: 0,
822 lparam: 0,
823 }
824 }
825}
826
827pub struct GetHoverTime {}
832
833impl MsgSend for GetHoverTime {
834 type RetType = Option<u32>;
835
836 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
837 zero_as_none(v).map(|idx| idx as _)
838 }
839
840 fn as_generic_wm(&mut self) -> WndMsg {
841 WndMsg {
842 msg_id: co::LVM::GETHOVERTIME.into(),
843 wparam: 0,
844 lparam: 0,
845 }
846 }
847}
848
849pub struct GetImageList {
854 pub kind: co::LVSIL,
855}
856
857impl MsgSend for GetImageList {
858 type RetType = Option<HIMAGELIST>;
859
860 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
861 zero_as_none(v).map(|p| HIMAGELIST::from_ptr(p as _))
862 }
863
864 fn as_generic_wm(&mut self) -> WndMsg {
865 WndMsg {
866 msg_id: co::LVM::GETIMAGELIST.into(),
867 wparam: self.kind.raw() as _,
868 lparam: 0,
869 }
870 }
871}
872
873pub struct GetInsertMark<'a> {
878 pub info: &'a mut LVINSERTMARK,
879}
880
881impl<'a> MsgSend for GetInsertMark<'a> {
882 type RetType = SysResult<()>;
883
884 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
885 zero_as_badargs(v).map(|_| ())
886 }
887
888 fn as_generic_wm(&mut self) -> WndMsg {
889 WndMsg {
890 msg_id: co::LVM::GETINSERTMARK.into(),
891 wparam: 0,
892 lparam: self.info as *mut _ as _,
893 }
894 }
895}
896
897pub struct GetInsertMarkColor {}
902
903impl MsgSend for GetInsertMarkColor {
904 type RetType = COLORREF;
905
906 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
907 COLORREF::from_raw(v as _)
908 }
909
910 fn as_generic_wm(&mut self) -> WndMsg {
911 WndMsg {
912 msg_id: co::LVM::GETINSERTMARKCOLOR.into(),
913 wparam: 0,
914 lparam: 0,
915 }
916 }
917}
918
919pub struct GetInsertMarkRect<'a> {
924 pub rect: &'a mut RECT,
925}
926
927impl<'a> MsgSend for GetInsertMarkRect<'a> {
928 type RetType = bool;
929
930 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
931 v != 0
932 }
933
934 fn as_generic_wm(&mut self) -> WndMsg {
935 WndMsg {
936 msg_id: co::LVM::GETINSERTMARKRECT.into(),
937 wparam: 0,
938 lparam: self.rect as *mut _ as _,
939 }
940 }
941}
942
943pub struct GetISearchString<'a> {
948 pub buffer: Option<&'a mut WString>,
949}
950
951impl<'a> MsgSend for GetISearchString<'a> {
952 type RetType = Option<u32>;
953
954 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
955 zero_as_none(v).map(|c| c as _)
956 }
957
958 fn as_generic_wm(&mut self) -> WndMsg {
959 WndMsg {
960 msg_id: co::LVM::GETISEARCHSTRING.into(),
961 wparam: 0,
962 lparam: self
963 .buffer
964 .as_mut()
965 .map_or(0, |buf| unsafe { buf.as_mut_ptr() } as _),
966 }
967 }
968}
969
970pub struct GetItem<'a, 'b> {
975 pub lvitem: &'b mut LVITEM<'a>,
976}
977
978impl<'a, 'b> MsgSend for GetItem<'a, 'b> {
979 type RetType = SysResult<()>;
980
981 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
982 zero_as_badargs(v).map(|_| ())
983 }
984
985 fn as_generic_wm(&mut self) -> WndMsg {
986 WndMsg {
987 msg_id: co::LVM::GETITEM.into(),
988 wparam: 0,
989 lparam: self.lvitem as *mut _ as _,
990 }
991 }
992}
993
994pub struct GetItemCount {}
999
1000impl MsgSend for GetItemCount {
1001 type RetType = u32;
1002
1003 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1004 v as _
1005 }
1006
1007 fn as_generic_wm(&mut self) -> WndMsg {
1008 WndMsg {
1009 msg_id: co::LVM::GETITEMCOUNT.into(),
1010 wparam: 0,
1011 lparam: 0,
1012 }
1013 }
1014}
1015
1016pub struct GetItemIndexRect<'a, 'b> {
1021 pub lvitemindex: &'a LVITEMINDEX,
1022 pub rect: &'b mut RECT,
1023 pub index: u32,
1024 pub portion: co::LVIR,
1025}
1026
1027impl<'a, 'b> MsgSend for GetItemIndexRect<'a, 'b> {
1028 type RetType = SysResult<()>;
1029
1030 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1031 zero_as_badargs(v).map(|_| ())
1032 }
1033
1034 fn as_generic_wm(&mut self) -> WndMsg {
1035 self.rect.top = self.index as _;
1036 self.rect.left = self.portion.raw() as _;
1037
1038 WndMsg {
1039 msg_id: co::LVM::GETITEMINDEXRECT.into(),
1040 wparam: self.lvitemindex as *const _ as _,
1041 lparam: self.rect as *mut _ as _,
1042 }
1043 }
1044}
1045
1046pub struct GetItemPosition<'a> {
1051 pub index: u32,
1052 pub pos: &'a mut POINT,
1053}
1054
1055impl<'a> MsgSend for GetItemPosition<'a> {
1056 type RetType = SysResult<()>;
1057
1058 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1059 zero_as_badargs(v).map(|_| ())
1060 }
1061
1062 fn as_generic_wm(&mut self) -> WndMsg {
1063 WndMsg {
1064 msg_id: co::LVM::GETITEMPOSITION.into(),
1065 wparam: self.index as _,
1066 lparam: self.pos as *mut _ as _,
1067 }
1068 }
1069}
1070
1071pub struct GetItemRect<'a> {
1076 pub index: u32,
1077 pub rect: &'a mut RECT,
1078 pub portion: co::LVIR,
1079}
1080
1081impl<'a> MsgSend for GetItemRect<'a> {
1082 type RetType = SysResult<()>;
1083
1084 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1085 zero_as_badargs(v).map(|_| ())
1086 }
1087
1088 fn as_generic_wm(&mut self) -> WndMsg {
1089 self.rect.left = self.portion.raw() as _;
1090
1091 WndMsg {
1092 msg_id: co::LVM::GETITEMRECT.into(),
1093 wparam: self.index as _,
1094 lparam: self.rect as *mut _ as _,
1095 }
1096 }
1097}
1098
1099pub struct GetItemSpacing {
1104 pub is_small_icon_view: bool,
1105}
1106
1107impl MsgSend for GetItemSpacing {
1108 type RetType = SIZE;
1109
1110 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1111 SIZE::from(v as u32)
1112 }
1113
1114 fn as_generic_wm(&mut self) -> WndMsg {
1115 WndMsg {
1116 msg_id: co::LVM::GETITEMSTATE.into(),
1117 wparam: self.is_small_icon_view as _,
1118 lparam: 0,
1119 }
1120 }
1121}
1122
1123pub struct GetItemState {
1128 pub index: u32,
1129 pub mask: co::LVIS,
1130}
1131
1132impl MsgSend for GetItemState {
1133 type RetType = co::LVIS;
1134
1135 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1136 co::LVIS::from_raw(v as _)
1137 }
1138
1139 fn as_generic_wm(&mut self) -> WndMsg {
1140 WndMsg {
1141 msg_id: co::LVM::GETITEMSTATE.into(),
1142 wparam: self.index as _,
1143 lparam: self.mask.raw() as _,
1144 }
1145 }
1146}
1147
1148pub struct GetItemText<'a, 'b> {
1153 pub index: u32,
1154 pub lvitem: &'b mut LVITEM<'a>,
1155}
1156
1157impl<'a, 'b> MsgSend for GetItemText<'a, 'b> {
1158 type RetType = u32;
1159
1160 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1161 v as _
1162 }
1163
1164 fn as_generic_wm(&mut self) -> WndMsg {
1165 WndMsg {
1166 msg_id: co::LVM::GETITEMTEXT.into(),
1167 wparam: self.index as _,
1168 lparam: self.lvitem as *mut _ as _,
1169 }
1170 }
1171}
1172
1173pub struct GetNextItem {
1178 pub initial_index: Option<u32>,
1179 pub relationship: co::LVNI,
1180}
1181
1182impl MsgSend for GetNextItem {
1183 type RetType = Option<u32>;
1184
1185 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1186 minus1_as_none(v).map(|v| v as _)
1187 }
1188
1189 fn as_generic_wm(&mut self) -> WndMsg {
1190 WndMsg {
1191 msg_id: co::LVM::GETNEXTITEM.into(),
1192 wparam: self.initial_index.map_or(-1, |idx| idx as i32) as _,
1193 lparam: self.relationship.raw() as _,
1194 }
1195 }
1196}
1197
1198pub struct GetNextItemIndex<'a> {
1203 pub initial_item: &'a mut LVITEMINDEX,
1204 pub relationship: co::LVNI,
1205}
1206
1207impl<'a> MsgSend for GetNextItemIndex<'a> {
1208 type RetType = SysResult<()>;
1209
1210 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1211 zero_as_badargs(v).map(|_| ())
1212 }
1213
1214 fn as_generic_wm(&mut self) -> WndMsg {
1215 WndMsg {
1216 msg_id: co::LVM::GETNEXTITEMINDEX.into(),
1217 wparam: self.initial_item as *mut _ as _,
1218 lparam: self.relationship.raw() as _,
1219 }
1220 }
1221}
1222
1223pub struct GetNumberOfWorkAreas<'a> {
1228 pub num: &'a mut u32,
1229}
1230
1231impl<'a> MsgSend for GetNumberOfWorkAreas<'a> {
1232 type RetType = ();
1233
1234 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
1235 ()
1236 }
1237
1238 fn as_generic_wm(&mut self) -> WndMsg {
1239 WndMsg {
1240 msg_id: co::LVM::GETNUMBEROFWORKAREAS.into(),
1241 wparam: 0,
1242 lparam: self.num as *mut _ as _,
1243 }
1244 }
1245}
1246
1247pub struct GetOrigin<'a> {
1252 pub origin: &'a mut POINT,
1253}
1254
1255impl<'a> MsgSend for GetOrigin<'a> {
1256 type RetType = bool;
1257
1258 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1259 v != 0
1260 }
1261
1262 fn as_generic_wm(&mut self) -> WndMsg {
1263 WndMsg {
1264 msg_id: co::LVM::GETORIGIN.into(),
1265 wparam: 0,
1266 lparam: self.origin as *mut _ as _,
1267 }
1268 }
1269}
1270
1271pub struct GetOutlineColor {}
1276
1277impl MsgSend for GetOutlineColor {
1278 type RetType = COLORREF;
1279
1280 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1281 COLORREF::from_raw(v as _)
1282 }
1283
1284 fn as_generic_wm(&mut self) -> WndMsg {
1285 WndMsg {
1286 msg_id: co::LVM::GETOUTLINECOLOR.into(),
1287 wparam: 0,
1288 lparam: 0,
1289 }
1290 }
1291}
1292
1293pub struct GetSelectedColumn {}
1298
1299impl MsgSend for GetSelectedColumn {
1300 type RetType = Option<u32>;
1301
1302 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1303 minus1_as_none(v).map(|v| v as _)
1304 }
1305
1306 fn as_generic_wm(&mut self) -> WndMsg {
1307 WndMsg {
1308 msg_id: co::LVM::GETSELECTEDCOLUMN.into(),
1309 wparam: 0,
1310 lparam: 0,
1311 }
1312 }
1313}
1314
1315pub struct GetSelectedCount {}
1320
1321impl MsgSend for GetSelectedCount {
1322 type RetType = u32;
1323
1324 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1325 v as _
1326 }
1327
1328 fn as_generic_wm(&mut self) -> WndMsg {
1329 WndMsg {
1330 msg_id: co::LVM::GETSELECTEDCOUNT.into(),
1331 wparam: 0,
1332 lparam: 0,
1333 }
1334 }
1335}
1336
1337pub struct GetSelectionMark {}
1342
1343impl MsgSend for GetSelectionMark {
1344 type RetType = Option<u32>;
1345
1346 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1347 minus1_as_none(v).map(|v| v as _)
1348 }
1349
1350 fn as_generic_wm(&mut self) -> WndMsg {
1351 WndMsg {
1352 msg_id: co::LVM::GETSELECTIONMARK.into(),
1353 wparam: 0,
1354 lparam: 0,
1355 }
1356 }
1357}
1358
1359pub struct GetStringWidth {
1364 pub text: WString,
1365}
1366
1367impl MsgSend for GetStringWidth {
1368 type RetType = SysResult<u32>;
1369
1370 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1371 zero_as_badargs(v).map(|len| len as _)
1372 }
1373
1374 fn as_generic_wm(&mut self) -> WndMsg {
1375 WndMsg {
1376 msg_id: co::LVM::GETSTRINGWIDTH.into(),
1377 wparam: 0,
1378 lparam: self.text.as_ptr() as _,
1379 }
1380 }
1381}
1382
1383pub struct GetSubItemRect<'a> {
1388 pub item_index: u32,
1389 pub subitem_index: u32,
1390 pub rect: &'a mut RECT,
1391 pub portion: co::LVIR,
1392}
1393
1394impl<'a> MsgSend for GetSubItemRect<'a> {
1395 type RetType = SysResult<()>;
1396
1397 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1398 zero_as_badargs(v).map(|_| ())
1399 }
1400
1401 fn as_generic_wm(&mut self) -> WndMsg {
1402 self.rect.left = self.portion.raw() as _;
1403 self.rect.top = self.subitem_index as _;
1404
1405 WndMsg {
1406 msg_id: co::LVM::GETSUBITEMRECT.into(),
1407 wparam: self.item_index as _,
1408 lparam: self.rect as *mut _ as _,
1409 }
1410 }
1411}
1412
1413pub struct GetTextBkColor {}
1418
1419impl MsgSend for GetTextBkColor {
1420 type RetType = COLORREF;
1421
1422 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1423 COLORREF::from_raw(v as _)
1424 }
1425
1426 fn as_generic_wm(&mut self) -> WndMsg {
1427 WndMsg {
1428 msg_id: co::LVM::GETTEXTBKCOLOR.into(),
1429 wparam: 0,
1430 lparam: 0,
1431 }
1432 }
1433}
1434
1435pub struct GetTextColor {}
1440
1441impl MsgSend for GetTextColor {
1442 type RetType = COLORREF;
1443
1444 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1445 COLORREF::from_raw(v as _)
1446 }
1447
1448 fn as_generic_wm(&mut self) -> WndMsg {
1449 WndMsg {
1450 msg_id: co::LVM::GETTEXTCOLOR.into(),
1451 wparam: 0,
1452 lparam: 0,
1453 }
1454 }
1455}
1456
1457pub struct GetTileInfo<'a, 'b> {
1462 pub info: &'b mut LVTILEINFO<'a>,
1463}
1464
1465impl<'a, 'b> MsgSend for GetTileInfo<'a, 'b> {
1466 type RetType = ();
1467
1468 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
1469 ()
1470 }
1471
1472 fn as_generic_wm(&mut self) -> WndMsg {
1473 WndMsg {
1474 msg_id: co::LVM::GETTILEINFO.into(),
1475 wparam: 0,
1476 lparam: self.info as *mut _ as _,
1477 }
1478 }
1479}
1480
1481pub struct GetTileViewInfo<'a> {
1486 pub info: &'a mut LVTILEVIEWINFO,
1487}
1488
1489impl<'a> MsgSend for GetTileViewInfo<'a> {
1490 type RetType = ();
1491
1492 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
1493 ()
1494 }
1495
1496 fn as_generic_wm(&mut self) -> WndMsg {
1497 WndMsg {
1498 msg_id: co::LVM::GETTILEVIEWINFO.into(),
1499 wparam: 0,
1500 lparam: self.info as *mut _ as _,
1501 }
1502 }
1503}
1504
1505pub struct GetTooltips {}
1510
1511impl MsgSend for GetTooltips {
1512 type RetType = Option<HWND>;
1513
1514 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1515 zero_as_none(v).map(|p| HWND::from_ptr(p as _))
1516 }
1517
1518 fn as_generic_wm(&mut self) -> WndMsg {
1519 WndMsg {
1520 msg_id: co::LVM::GETTOOLTIPS.into(),
1521 wparam: 0,
1522 lparam: 0,
1523 }
1524 }
1525}
1526
1527pub struct GetTopIndex {}
1535
1536impl MsgSend for GetTopIndex {
1537 type RetType = u32;
1538
1539 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1540 v as _
1541 }
1542
1543 fn as_generic_wm(&mut self) -> WndMsg {
1544 WndMsg {
1545 msg_id: co::LVM::GETTOPINDEX.into(),
1546 wparam: 0,
1547 lparam: 0,
1548 }
1549 }
1550}
1551
1552pub struct GetUnicodeFormat {}
1557
1558impl MsgSend for GetUnicodeFormat {
1559 type RetType = bool;
1560
1561 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1562 v != 0
1563 }
1564
1565 fn as_generic_wm(&mut self) -> WndMsg {
1566 WndMsg {
1567 msg_id: co::LVM::GETUNICODEFORMAT.into(),
1568 wparam: 0,
1569 lparam: 0,
1570 }
1571 }
1572}
1573
1574pub struct GetView {}
1579
1580impl MsgSend for GetView {
1581 type RetType = co::LV_VIEW;
1582
1583 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1584 co::LV_VIEW::from_raw(v as _)
1585 }
1586
1587 fn as_generic_wm(&mut self) -> WndMsg {
1588 WndMsg {
1589 msg_id: co::LVM::GETVIEW.into(),
1590 wparam: 0,
1591 lparam: 0,
1592 }
1593 }
1594}
1595
1596pub struct GetViewRect<'a> {
1601 pub rect: &'a mut RECT,
1602}
1603
1604impl<'a> MsgSend for GetViewRect<'a> {
1605 type RetType = SysResult<()>;
1606
1607 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1608 zero_as_badargs(v).map(|_| ())
1609 }
1610
1611 fn as_generic_wm(&mut self) -> WndMsg {
1612 WndMsg {
1613 msg_id: co::LVM::GETVIEWRECT.into(),
1614 wparam: 0,
1615 lparam: self.rect as *mut _ as _,
1616 }
1617 }
1618}
1619
1620pub struct GetWorkAreas<'a> {
1625 pub rects: &'a mut [RECT],
1626}
1627
1628impl<'a> MsgSend for GetWorkAreas<'a> {
1629 type RetType = ();
1630
1631 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
1632 ()
1633 }
1634
1635 fn as_generic_wm(&mut self) -> WndMsg {
1636 WndMsg {
1637 msg_id: co::LVM::GETWORKAREAS.into(),
1638 wparam: self.rects.len() as _,
1639 lparam: self.rects.as_mut_ptr() as _,
1640 }
1641 }
1642}
1643
1644pub struct HasGroup {
1649 pub id: u32,
1650}
1651
1652impl MsgSend for HasGroup {
1653 type RetType = bool;
1654
1655 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1656 v != 0
1657 }
1658
1659 fn as_generic_wm(&mut self) -> WndMsg {
1660 WndMsg {
1661 msg_id: co::LVM::HASGROUP.into(),
1662 wparam: self.id as _,
1663 lparam: 0,
1664 }
1665 }
1666}
1667
1668pub struct HitTest<'a> {
1673 pub info: &'a mut LVHITTESTINFO,
1674}
1675
1676impl<'a> MsgSend for HitTest<'a> {
1677 type RetType = Option<u32>;
1678
1679 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1680 minus1_as_none(v).map(|v| v as _)
1681 }
1682
1683 fn as_generic_wm(&mut self) -> WndMsg {
1684 WndMsg {
1685 msg_id: co::LVM::HITTEST.into(),
1686 wparam: -1 as _,
1687 lparam: self.info as *mut _ as _,
1688 }
1689 }
1690}
1691
1692pub struct InsertColumn<'a, 'b> {
1697 pub index: u32,
1698 pub column: &'b LVCOLUMN<'a>,
1699}
1700
1701impl<'a, 'b> MsgSend for InsertColumn<'a, 'b> {
1702 type RetType = SysResult<u32>;
1703
1704 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1705 minus1_as_badargs(v).map(|v| v as _)
1706 }
1707
1708 fn as_generic_wm(&mut self) -> WndMsg {
1709 WndMsg {
1710 msg_id: co::LVM::INSERTCOLUMN.into(),
1711 wparam: self.index as _,
1712 lparam: self.column as *const _ as _,
1713 }
1714 }
1715}
1716
1717pub struct InsertGroup<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
1722 pub group: &'h LVGROUP<'a, 'b, 'c, 'd, 'e, 'f, 'g>,
1723}
1724
1725impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> MsgSend for InsertGroup<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
1726 type RetType = SysResult<u32>;
1727
1728 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1729 minus1_as_badargs(v).map(|v| v as _)
1730 }
1731
1732 fn as_generic_wm(&mut self) -> WndMsg {
1733 WndMsg {
1734 msg_id: co::LVM::INSERTGROUP.into(),
1735 wparam: 0,
1736 lparam: self.group as *const _ as _,
1737 }
1738 }
1739}
1740
1741pub struct InsertGroupSorted<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
1746 pub group: &'h LVINSERTGROUPSORTED<'a, 'b, 'c, 'd, 'e, 'f, 'g>,
1747}
1748
1749impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> MsgSend for InsertGroupSorted<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
1750 type RetType = ();
1751
1752 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
1753 ()
1754 }
1755
1756 fn as_generic_wm(&mut self) -> WndMsg {
1757 WndMsg {
1758 msg_id: co::LVM::INSERTGROUPSORTED.into(),
1759 wparam: 0,
1760 lparam: self.group as *const _ as _,
1761 }
1762 }
1763}
1764
1765pub struct InsertItem<'a, 'b> {
1770 pub item: &'b LVITEM<'a>,
1771}
1772
1773impl<'a, 'b> MsgSend for InsertItem<'a, 'b> {
1774 type RetType = SysResult<u32>;
1775
1776 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1777 minus1_as_badargs(v).map(|v| v as _)
1778 }
1779
1780 fn as_generic_wm(&mut self) -> WndMsg {
1781 WndMsg {
1782 msg_id: co::LVM::INSERTITEM.into(),
1783 wparam: 0,
1784 lparam: self.item as *const _ as _,
1785 }
1786 }
1787}
1788
1789pub struct InsertMarkHitTest<'a> {
1794 pub point: POINT,
1795 pub insert_mark: &'a LVINSERTMARK,
1796}
1797
1798impl<'a, 'b> MsgSend for InsertMarkHitTest<'a> {
1799 type RetType = SysResult<()>;
1800
1801 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1802 zero_as_badargs(v).map(|_| ())
1803 }
1804
1805 fn as_generic_wm(&mut self) -> WndMsg {
1806 WndMsg {
1807 msg_id: co::LVM::INSERTMARKHITTEST.into(),
1808 wparam: &self.point as *const _ as _,
1809 lparam: self.insert_mark as *const _ as _,
1810 }
1811 }
1812}
1813
1814pub struct IsGroupViewEnabled {}
1819
1820impl MsgSend for IsGroupViewEnabled {
1821 type RetType = bool;
1822
1823 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1824 v != 0
1825 }
1826
1827 fn as_generic_wm(&mut self) -> WndMsg {
1828 WndMsg {
1829 msg_id: co::LVM::ISGROUPVIEWENABLED.into(),
1830 wparam: 0,
1831 lparam: 0,
1832 }
1833 }
1834}
1835
1836pub struct IsItemVisible {
1841 pub index: u32,
1842}
1843
1844impl MsgSend for IsItemVisible {
1845 type RetType = bool;
1846
1847 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1848 v != 0
1849 }
1850
1851 fn as_generic_wm(&mut self) -> WndMsg {
1852 WndMsg {
1853 msg_id: co::LVM::ISITEMVISIBLE.into(),
1854 wparam: self.index as _,
1855 lparam: 0,
1856 }
1857 }
1858}
1859
1860pub struct MapIdToIndex {
1865 pub id: u32,
1866}
1867
1868impl MsgSend for MapIdToIndex {
1869 type RetType = Option<u32>;
1870
1871 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1872 minus1_as_none(v).map(|v| v as _)
1873 }
1874
1875 fn as_generic_wm(&mut self) -> WndMsg {
1876 WndMsg {
1877 msg_id: co::LVM::MAPIDTOINDEX.into(),
1878 wparam: self.id as _,
1879 lparam: 0,
1880 }
1881 }
1882}
1883
1884pub struct MapIndexToId {
1889 pub index: u32,
1890}
1891
1892impl MsgSend for MapIndexToId {
1893 type RetType = Option<u32>;
1894
1895 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1896 minus1_as_none(v).map(|v| v as _)
1897 }
1898
1899 fn as_generic_wm(&mut self) -> WndMsg {
1900 WndMsg {
1901 msg_id: co::LVM::MAPINDEXTOID.into(),
1902 wparam: self.index as _,
1903 lparam: 0,
1904 }
1905 }
1906}
1907
1908pub struct RedrawItems {
1913 pub first_index: u32,
1914 pub last_index: u32,
1915}
1916
1917impl MsgSend for RedrawItems {
1918 type RetType = SysResult<()>;
1919
1920 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1921 zero_as_badargs(v).map(|_| ())
1922 }
1923
1924 fn as_generic_wm(&mut self) -> WndMsg {
1925 WndMsg {
1926 msg_id: co::LVM::REDRAWITEMS.into(),
1927 wparam: self.first_index as _,
1928 lparam: self.last_index as _,
1929 }
1930 }
1931}
1932
1933pub_struct_msg_empty! { RemoveAllGroups: co::LVM::REMOVEALLGROUPS.into();
1934 }
1939
1940pub struct RemoveGroup {
1945 pub id: u32,
1946}
1947
1948impl MsgSend for RemoveGroup {
1949 type RetType = SysResult<u32>;
1950
1951 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1952 zero_as_badargs(v).map(|id| id as _)
1953 }
1954
1955 fn as_generic_wm(&mut self) -> WndMsg {
1956 WndMsg {
1957 msg_id: co::LVM::REMOVEGROUP.into(),
1958 wparam: self.id as _,
1959 lparam: 0,
1960 }
1961 }
1962}
1963
1964pub struct Scroll {
1969 pub horizontal: i32,
1970 pub vertical: i32,
1971}
1972
1973impl MsgSend for Scroll {
1974 type RetType = SysResult<()>;
1975
1976 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
1977 zero_as_badargs(v).map(|_| ())
1978 }
1979
1980 fn as_generic_wm(&mut self) -> WndMsg {
1981 WndMsg {
1982 msg_id: co::LVM::SCROLL.into(),
1983 wparam: self.horizontal as _,
1984 lparam: self.vertical as _,
1985 }
1986 }
1987}
1988
1989pub struct SetBkColor {
1994 pub color: Option<COLORREF>,
1995}
1996
1997impl MsgSend for SetBkColor {
1998 type RetType = SysResult<()>;
1999
2000 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2001 zero_as_badargs(v).map(|_| ())
2002 }
2003
2004 fn as_generic_wm(&mut self) -> WndMsg {
2005 WndMsg {
2006 msg_id: co::LVM::SETBKCOLOR.into(),
2007 wparam: 0,
2008 lparam: self.color.map_or(co::CLR::NONE.raw(), |c| c.raw()) as _,
2009 }
2010 }
2011}
2012
2013pub struct SetBkImage<'a, 'b> {
2018 pub lvbkimage: &'b LVBKIMAGE<'a>,
2019}
2020
2021impl<'a, 'b> MsgSend for SetBkImage<'a, 'b> {
2022 type RetType = SysResult<()>;
2023
2024 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2025 zero_as_badargs(v).map(|_| ())
2026 }
2027
2028 fn as_generic_wm(&mut self) -> WndMsg {
2029 WndMsg {
2030 msg_id: co::LVM::SETBKIMAGE.into(),
2031 wparam: 0,
2032 lparam: self.lvbkimage as *const _ as _,
2033 }
2034 }
2035}
2036
2037pub struct SetCallbackMask {
2042 pub mask: co::LVIS,
2043}
2044
2045impl MsgSend for SetCallbackMask {
2046 type RetType = SysResult<()>;
2047
2048 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2049 zero_as_badargs(v).map(|_| ())
2050 }
2051
2052 fn as_generic_wm(&mut self) -> WndMsg {
2053 WndMsg {
2054 msg_id: co::LVM::SETCALLBACKMASK.into(),
2055 wparam: self.mask.raw() as _,
2056 lparam: 0,
2057 }
2058 }
2059}
2060
2061pub struct SetColumn<'a, 'b> {
2066 pub index: u32,
2067 pub lvcolumn: &'b LVCOLUMN<'a>,
2068}
2069
2070impl<'a, 'b> MsgSend for SetColumn<'a, 'b> {
2071 type RetType = SysResult<()>;
2072
2073 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2074 zero_as_badargs(v).map(|_| ())
2075 }
2076
2077 fn as_generic_wm(&mut self) -> WndMsg {
2078 WndMsg {
2079 msg_id: co::LVM::SETCOLUMN.into(),
2080 wparam: self.index as _,
2081 lparam: self.lvcolumn as *const _ as _,
2082 }
2083 }
2084}
2085
2086pub struct SetColumnOrderArray<'a> {
2091 pub order: &'a [u32],
2092}
2093
2094impl<'a> MsgSend for SetColumnOrderArray<'a> {
2095 type RetType = SysResult<()>;
2096
2097 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2098 zero_as_badargs(v).map(|_| ())
2099 }
2100
2101 fn as_generic_wm(&mut self) -> WndMsg {
2102 WndMsg {
2103 msg_id: co::LVM::SETCOLUMNORDERARRAY.into(),
2104 wparam: self.order.len() as _,
2105 lparam: vec_ptr(self.order) as _,
2106 }
2107 }
2108}
2109
2110pub struct SetColumnWidth {
2115 pub index: u32,
2116 pub width: u32,
2117}
2118
2119impl MsgSend for SetColumnWidth {
2120 type RetType = SysResult<()>;
2121
2122 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2123 zero_as_badargs(v).map(|_| ())
2124 }
2125
2126 fn as_generic_wm(&mut self) -> WndMsg {
2127 WndMsg {
2128 msg_id: co::LVM::SETCOLUMNWIDTH.into(),
2129 wparam: self.index as _,
2130 lparam: self.width as _,
2131 }
2132 }
2133}
2134
2135pub struct SetExtendedListViewStyle {
2140 pub style: co::LVS_EX,
2141 pub mask: co::LVS_EX,
2142}
2143
2144impl MsgSend for SetExtendedListViewStyle {
2145 type RetType = co::LVS_EX;
2146
2147 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2148 co::LVS_EX::from_raw(v as _)
2149 }
2150
2151 fn as_generic_wm(&mut self) -> WndMsg {
2152 WndMsg {
2153 msg_id: co::LVM::SETEXTENDEDLISTVIEWSTYLE.into(),
2154 wparam: self.style.raw() as _,
2155 lparam: self.mask.raw() as _,
2156 }
2157 }
2158}
2159
2160pub struct SetGroupInfo<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
2165 pub id: u32,
2166 pub info: &'h LVGROUP<'a, 'b, 'c, 'd, 'e, 'f, 'g>,
2167}
2168
2169impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> MsgSend for SetGroupInfo<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> {
2170 type RetType = SysResult<u32>;
2171
2172 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2173 minus1_as_badargs(v).map(|v| v as _)
2174 }
2175
2176 fn as_generic_wm(&mut self) -> WndMsg {
2177 WndMsg {
2178 msg_id: co::LVM::SETGROUPINFO.into(),
2179 wparam: self.id as _,
2180 lparam: self.info as *const _ as _,
2181 }
2182 }
2183}
2184
2185pub struct SetGroupMetrics<'a> {
2190 pub info: &'a LVGROUPMETRICS,
2191}
2192
2193impl<'a> MsgSend for SetGroupMetrics<'a> {
2194 type RetType = ();
2195
2196 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
2197 ()
2198 }
2199
2200 fn as_generic_wm(&mut self) -> WndMsg {
2201 WndMsg {
2202 msg_id: co::LVM::SETGROUPMETRICS.into(),
2203 wparam: 0,
2204 lparam: self.info as *const _ as _,
2205 }
2206 }
2207}
2208
2209pub struct SetHotCursor<'a> {
2214 pub hcursor: Option<&'a HCURSOR>,
2215}
2216
2217impl<'a> MsgSend for SetHotCursor<'a> {
2218 type RetType = Option<HCURSOR>;
2219
2220 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2221 zero_as_none(v).map(|p| HCURSOR::from_ptr(p as _))
2222 }
2223
2224 fn as_generic_wm(&mut self) -> WndMsg {
2225 WndMsg {
2226 msg_id: co::LVM::SETHOTCURSOR.into(),
2227 wparam: 0,
2228 lparam: self.hcursor.map_or(0, |h| h.ptr() as _),
2229 }
2230 }
2231}
2232
2233pub struct SetHotItem {
2238 pub index: Option<u32>,
2239}
2240
2241impl MsgSend for SetHotItem {
2242 type RetType = Option<u32>;
2243
2244 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2245 minus1_as_none(v).map(|v| v as _)
2246 }
2247
2248 fn as_generic_wm(&mut self) -> WndMsg {
2249 WndMsg {
2250 msg_id: co::LVM::SETHOTITEM.into(),
2251 wparam: self.index.unwrap_or(0) as _,
2252 lparam: 0,
2253 }
2254 }
2255}
2256
2257pub struct SetHoverTime {
2262 pub ms: Option<u32>,
2263}
2264
2265impl MsgSend for SetHoverTime {
2266 type RetType = Option<u32>;
2267
2268 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2269 minus1_as_none(v).map(|v| v as _)
2270 }
2271
2272 fn as_generic_wm(&mut self) -> WndMsg {
2273 WndMsg {
2274 msg_id: co::LVM::SETHOVERTIME.into(),
2275 wparam: self.ms.map_or(-1, |ms| ms as i32) as _,
2276 lparam: 0,
2277 }
2278 }
2279}
2280
2281pub struct SetIconSpacing {
2286 pub size: SIZE,
2287}
2288
2289impl MsgSend for SetIconSpacing {
2290 type RetType = SIZE;
2291
2292 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2293 SIZE::from(v as u32)
2294 }
2295
2296 fn as_generic_wm(&mut self) -> WndMsg {
2297 WndMsg {
2298 msg_id: co::LVM::SETICONSPACING.into(),
2299 wparam: 0,
2300 lparam: u32::from(self.size) as _,
2301 }
2302 }
2303}
2304
2305pub struct SetImageList {
2310 pub kind: co::LVSIL,
2311 pub himagelist: Option<HIMAGELIST>,
2312}
2313
2314impl MsgSend for SetImageList {
2315 type RetType = Option<HIMAGELIST>;
2316
2317 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2318 zero_as_none(v).map(|p| HIMAGELIST::from_ptr(p as _))
2319 }
2320
2321 fn as_generic_wm(&mut self) -> WndMsg {
2322 WndMsg {
2323 msg_id: co::LVM::SETIMAGELIST.into(),
2324 wparam: self.kind.raw() as _,
2325 lparam: self.himagelist.as_ref().map_or(0, |h| h.ptr() as _),
2326 }
2327 }
2328}
2329
2330pub struct SetInfoTip<'a, 'b> {
2335 pub info: &'b LVSETINFOTIP<'a>,
2336}
2337
2338impl<'a, 'b> MsgSend for SetInfoTip<'a, 'b> {
2339 type RetType = SysResult<()>;
2340
2341 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2342 zero_as_badargs(v).map(|_| ())
2343 }
2344
2345 fn as_generic_wm(&mut self) -> WndMsg {
2346 WndMsg {
2347 msg_id: co::LVM::SETINFOTIP.into(),
2348 wparam: 0,
2349 lparam: self.info as *const _ as _,
2350 }
2351 }
2352}
2353
2354pub struct SetInsertMark<'a> {
2359 pub info: &'a LVINSERTMARK,
2360}
2361
2362impl<'a> MsgSend for SetInsertMark<'a> {
2363 type RetType = SysResult<()>;
2364
2365 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2366 zero_as_badargs(v).map(|_| ())
2367 }
2368
2369 fn as_generic_wm(&mut self) -> WndMsg {
2370 WndMsg {
2371 msg_id: co::LVM::SETINSERTMARK.into(),
2372 wparam: 0,
2373 lparam: self.info as *const _ as _,
2374 }
2375 }
2376}
2377
2378pub struct SetInsertMarkColor {
2383 pub color: COLORREF,
2384}
2385
2386impl MsgSend for SetInsertMarkColor {
2387 type RetType = COLORREF;
2388
2389 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2390 COLORREF::from_raw(v as _)
2391 }
2392
2393 fn as_generic_wm(&mut self) -> WndMsg {
2394 WndMsg {
2395 msg_id: co::LVM::SETINSERTMARKCOLOR.into(),
2396 wparam: 0,
2397 lparam: u32::from(self.color) as _,
2398 }
2399 }
2400}
2401
2402pub struct SetItem<'a, 'b> {
2407 pub lvitem: &'b LVITEM<'a>,
2408}
2409
2410impl<'a, 'b> MsgSend for SetItem<'a, 'b> {
2411 type RetType = SysResult<()>;
2412
2413 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2414 zero_as_badargs(v).map(|_| ())
2415 }
2416
2417 fn as_generic_wm(&mut self) -> WndMsg {
2418 WndMsg {
2419 msg_id: co::LVM::SETITEM.into(),
2420 wparam: 0,
2421 lparam: self.lvitem as *const _ as _,
2422 }
2423 }
2424}
2425
2426pub struct SetItemCount {
2431 pub count: u32,
2432 pub behavior: Option<co::LVSICF>,
2433}
2434
2435impl MsgSend for SetItemCount {
2436 type RetType = SysResult<()>;
2437
2438 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2439 zero_as_badargs(v).map(|_| ())
2440 }
2441
2442 fn as_generic_wm(&mut self) -> WndMsg {
2443 WndMsg {
2444 msg_id: co::LVM::SETITEMCOUNT.into(),
2445 wparam: self.count as _,
2446 lparam: self.behavior.unwrap_or_default().raw() as _,
2447 }
2448 }
2449}
2450
2451pub struct SetItemIndexState<'a, 'b, 'c> {
2456 pub lvitemindex: &'a LVITEMINDEX,
2457 pub lvitem: &'c LVITEM<'b>,
2458}
2459
2460impl<'a, 'b, 'c> MsgSend for SetItemIndexState<'a, 'b, 'c> {
2461 type RetType = HrResult<()>;
2462
2463 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2464 ok_to_hrresult(v as _)
2465 }
2466
2467 fn as_generic_wm(&mut self) -> WndMsg {
2468 WndMsg {
2469 msg_id: co::LVM::SETITEMINDEXSTATE.into(),
2470 wparam: self.lvitemindex as *const _ as _,
2471 lparam: self.lvitem as *const _ as _,
2472 }
2473 }
2474}
2475
2476pub struct SetItemPosition {
2481 pub index: u32,
2482 pub position: POINT,
2483}
2484
2485impl MsgSend for SetItemPosition {
2486 type RetType = SysResult<()>;
2487
2488 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2489 zero_as_badargs(v).map(|_| ())
2490 }
2491
2492 fn as_generic_wm(&mut self) -> WndMsg {
2493 WndMsg {
2494 msg_id: co::LVM::SETITEMPOSITION.into(),
2495 wparam: self.index as _,
2496 lparam: u32::from(self.position) as _,
2497 }
2498 }
2499}
2500
2501pub struct SetItemPosition32 {
2506 pub index: u32,
2507 pub position: POINT,
2508}
2509
2510impl MsgSend for SetItemPosition32 {
2511 type RetType = ();
2512
2513 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
2514 ()
2515 }
2516
2517 fn as_generic_wm(&mut self) -> WndMsg {
2518 WndMsg {
2519 msg_id: co::LVM::SETITEMPOSITION32.into(),
2520 wparam: self.index as _,
2521 lparam: &self.position as *const _ as _,
2522 }
2523 }
2524}
2525
2526pub struct SetItemState<'a, 'b> {
2531 pub index: Option<u32>,
2532 pub lvitem: &'b LVITEM<'a>,
2533}
2534
2535impl<'a, 'b> MsgSend for SetItemState<'a, 'b> {
2536 type RetType = SysResult<()>;
2537
2538 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2539 zero_as_badargs(v).map(|_| ())
2540 }
2541
2542 fn as_generic_wm(&mut self) -> WndMsg {
2543 WndMsg {
2544 msg_id: co::LVM::SETITEMSTATE.into(),
2545 wparam: self.index.map_or(-1, |idx| idx as i32) as _,
2546 lparam: self.lvitem as *const _ as _,
2547 }
2548 }
2549}
2550
2551pub struct SetItemText<'a, 'b> {
2556 pub index: u32,
2557 pub lvitem: &'b LVITEM<'a>,
2558}
2559
2560impl<'a, 'b> MsgSend for SetItemText<'a, 'b> {
2561 type RetType = SysResult<()>;
2562
2563 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2564 zero_as_badargs(v).map(|_| ())
2565 }
2566
2567 fn as_generic_wm(&mut self) -> WndMsg {
2568 WndMsg {
2569 msg_id: co::LVM::SETITEMTEXT.into(),
2570 wparam: self.index as _,
2571 lparam: self.lvitem as *const _ as _,
2572 }
2573 }
2574}
2575
2576pub struct SetOutlineColor {
2581 pub color: COLORREF,
2582}
2583
2584impl MsgSend for SetOutlineColor {
2585 type RetType = COLORREF;
2586
2587 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2588 COLORREF::from_raw(v as _)
2589 }
2590
2591 fn as_generic_wm(&mut self) -> WndMsg {
2592 WndMsg {
2593 msg_id: co::LVM::SETOUTLINECOLOR.into(),
2594 wparam: 0,
2595 lparam: u32::from(self.color) as _,
2596 }
2597 }
2598}
2599
2600pub struct SetSelectedColumn {
2605 pub index: u32,
2606}
2607
2608impl MsgSend for SetSelectedColumn {
2609 type RetType = ();
2610
2611 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
2612 ()
2613 }
2614
2615 fn as_generic_wm(&mut self) -> WndMsg {
2616 WndMsg {
2617 msg_id: co::LVM::SETSELECTEDCOLUMN.into(),
2618 wparam: self.index as _,
2619 lparam: 0,
2620 }
2621 }
2622}
2623
2624pub struct SetSelectionMark {
2629 pub index: Option<u32>,
2630}
2631
2632impl MsgSend for SetSelectionMark {
2633 type RetType = Option<u32>;
2634
2635 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2636 minus1_as_none(v).map(|v| v as _)
2637 }
2638
2639 fn as_generic_wm(&mut self) -> WndMsg {
2640 WndMsg {
2641 msg_id: co::LVM::SETSELECTIONMARK.into(),
2642 wparam: 0,
2643 lparam: self.index.map_or(-1, |idx| idx as i32) as _,
2644 }
2645 }
2646}
2647
2648pub struct SetTextBkColor {
2653 pub color: Option<COLORREF>,
2654}
2655
2656impl MsgSend for SetTextBkColor {
2657 type RetType = SysResult<()>;
2658
2659 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2660 zero_as_badargs(v).map(|_| ())
2661 }
2662
2663 fn as_generic_wm(&mut self) -> WndMsg {
2664 WndMsg {
2665 msg_id: co::LVM::SETTEXTBKCOLOR.into(),
2666 wparam: 0,
2667 lparam: self.color.map_or(co::CLR::NONE.raw(), |c| c.raw()) as _,
2668 }
2669 }
2670}
2671
2672pub struct SetTextColor {
2677 pub color: Option<COLORREF>,
2678}
2679
2680impl MsgSend for SetTextColor {
2681 type RetType = SysResult<()>;
2682
2683 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2684 zero_as_badargs(v).map(|_| ())
2685 }
2686
2687 fn as_generic_wm(&mut self) -> WndMsg {
2688 WndMsg {
2689 msg_id: co::LVM::SETTEXTCOLOR.into(),
2690 wparam: 0,
2691 lparam: self.color.map_or(co::CLR::NONE.raw(), |c| c.raw()) as _,
2692 }
2693 }
2694}
2695
2696pub struct SetTileInfo<'a, 'b> {
2701 pub info: &'b LVTILEINFO<'a>,
2702}
2703
2704impl<'a, 'b> MsgSend for SetTileInfo<'a, 'b> {
2705 type RetType = SysResult<()>;
2706
2707 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2708 zero_as_badargs(v).map(|_| ())
2709 }
2710
2711 fn as_generic_wm(&mut self) -> WndMsg {
2712 WndMsg {
2713 msg_id: co::LVM::SETTILEINFO.into(),
2714 wparam: 0,
2715 lparam: self.info as *const _ as _,
2716 }
2717 }
2718}
2719
2720pub struct SetTileViewInfo<'a> {
2725 pub info: &'a LVTILEVIEWINFO,
2726}
2727
2728impl<'a> MsgSend for SetTileViewInfo<'a> {
2729 type RetType = SysResult<()>;
2730
2731 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2732 zero_as_badargs(v).map(|_| ())
2733 }
2734
2735 fn as_generic_wm(&mut self) -> WndMsg {
2736 WndMsg {
2737 msg_id: co::LVM::SETTILEVIEWINFO.into(),
2738 wparam: 0,
2739 lparam: self.info as *const _ as _,
2740 }
2741 }
2742}
2743
2744pub struct SetTooltips<'a> {
2749 pub htooltips: Option<&'a HWND>,
2750}
2751
2752impl<'a> MsgSend for SetTooltips<'a> {
2753 type RetType = Option<HWND>;
2754
2755 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2756 zero_as_none(v).map(|p| HWND::from_ptr(p as _))
2757 }
2758
2759 fn as_generic_wm(&mut self) -> WndMsg {
2760 WndMsg {
2761 msg_id: co::LVM::SETTOOLTIPS.into(),
2762 wparam: self.htooltips.map_or(0, |h| h.ptr() as _),
2763 lparam: 0,
2764 }
2765 }
2766}
2767
2768pub struct SetUnicodeFormat {
2773 pub use_unicode: bool,
2774}
2775
2776impl MsgSend for SetUnicodeFormat {
2777 type RetType = bool;
2778
2779 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2780 v != 0
2781 }
2782
2783 fn as_generic_wm(&mut self) -> WndMsg {
2784 WndMsg {
2785 msg_id: co::LVM::SETUNICODEFORMAT.into(),
2786 wparam: self.use_unicode as _,
2787 lparam: 0,
2788 }
2789 }
2790}
2791
2792pub struct SetView {
2797 pub view: co::LV_VIEW,
2798}
2799
2800impl MsgSend for SetView {
2801 type RetType = SysResult<()>;
2802
2803 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2804 minus1_as_badargs(v).map(|_| ())
2805 }
2806
2807 fn as_generic_wm(&mut self) -> WndMsg {
2808 WndMsg {
2809 msg_id: co::LVM::SETVIEW.into(),
2810 wparam: self.view.raw() as _,
2811 lparam: 0,
2812 }
2813 }
2814}
2815
2816pub struct SetWorkAreas<'a> {
2821 pub rects: Option<&'a [RECT]>,
2822}
2823
2824impl<'a> MsgSend for SetWorkAreas<'a> {
2825 type RetType = ();
2826
2827 unsafe fn isize_to_ret(&self, _: isize) -> Self::RetType {
2828 ()
2829 }
2830
2831 fn as_generic_wm(&mut self) -> WndMsg {
2832 WndMsg {
2833 msg_id: co::LVM::SETWORKAREAS.into(),
2834 wparam: self.rects.map_or(0, |r| r.len() as _),
2835 lparam: self.rects.map_or(0, |r| vec_ptr(r) as _),
2836 }
2837 }
2838}
2839
2840pub struct SortGroups {
2845 pub callback: Option<PFNLVGROUPCOMPARE>,
2846 pub param: Option<isize>,
2847}
2848
2849impl MsgSend for SortGroups {
2850 type RetType = SysResult<()>;
2851
2852 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2853 zero_as_badargs(v).map(|_| ())
2854 }
2855
2856 fn as_generic_wm(&mut self) -> WndMsg {
2857 WndMsg {
2858 msg_id: co::LVM::SORTGROUPS.into(),
2859 wparam: self.callback.map_or(0, |cb| cb as _),
2860 lparam: self.param.unwrap_or(0),
2861 }
2862 }
2863}
2864
2865pub struct SortItems {
2870 pub param: isize,
2871 pub callback: PFNLVCOMPARE,
2872}
2873
2874impl MsgSend for SortItems {
2875 type RetType = SysResult<()>;
2876
2877 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2878 zero_as_badargs(v).map(|_| ())
2879 }
2880
2881 fn as_generic_wm(&mut self) -> WndMsg {
2882 WndMsg {
2883 msg_id: co::LVM::SORTITEMS.into(),
2884 wparam: self.param as _,
2885 lparam: self.callback as _,
2886 }
2887 }
2888}
2889
2890pub struct SortItemsEx {
2895 pub param: isize,
2896 pub callback: PFNLVCOMPARE,
2897}
2898
2899impl MsgSend for SortItemsEx {
2900 type RetType = SysResult<()>;
2901
2902 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2903 zero_as_badargs(v).map(|_| ())
2904 }
2905
2906 fn as_generic_wm(&mut self) -> WndMsg {
2907 WndMsg {
2908 msg_id: co::LVM::SORTITEMSEX.into(),
2909 wparam: self.param as _,
2910 lparam: self.callback as _,
2911 }
2912 }
2913}
2914
2915pub struct SubItemHitTest<'a> {
2920 pub info: &'a mut LVHITTESTINFO,
2921}
2922
2923impl<'a> MsgSend for SubItemHitTest<'a> {
2924 type RetType = Option<u32>;
2925
2926 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2927 minus1_as_none(v).map(|v| v as _)
2928 }
2929
2930 fn as_generic_wm(&mut self) -> WndMsg {
2931 WndMsg {
2932 msg_id: co::LVM::SUBITEMHITTEST.into(),
2933 wparam: -1 as _,
2934 lparam: self.info as *mut _ as _,
2935 }
2936 }
2937}
2938
2939pub struct Update {
2944 pub index: u32,
2945}
2946
2947impl MsgSend for Update {
2948 type RetType = SysResult<()>;
2949
2950 unsafe fn isize_to_ret(&self, v: isize) -> Self::RetType {
2951 zero_as_badargs(v).map(|_| ())
2952 }
2953
2954 fn as_generic_wm(&mut self) -> WndMsg {
2955 WndMsg {
2956 msg_id: co::LVM::UPDATE.into(),
2957 wparam: self.index as _,
2958 lparam: 0,
2959 }
2960 }
2961}